﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using com.google.zxing.common;
using Microsoft.Xna.Framework;

namespace Spinning
{
    class ConvertMatrixToArray
    {
        public Color[] doConvert(ByteMatrix bM)
        {
            int rows = bM.Width;
            int cols = bM.Height;
            Color[] byteArray = new Color[rows * cols];
            int current = 0;
            for (int i = 0; i < rows; i++)
            {
                for (int j = 0; j < cols; j++)
                {
                    if (bM.get_Renamed(j, i) != -1)//b
                        byteArray[current++] = Color.Black;
                    else
                        byteArray[current++] = Color.White;
                }
            }
            return byteArray;
        }
    }
}
